#pragma once
#include <stdlib.h>
#include "tinyxml.h"
#include "Canvas.h"
#include "Button.h"
#include "Image.h"
#include "Info.h"
#include "Peer.h"

class UIManager{
    public:
        UIManager();

        void AddCanvas(Canvas*);
        void SwithToCanv(int);

        void unload();
        void load();

        bool ParseDoc(TiXmlDocument*);
        bool genUI(TiXmlElement*);

        void run();
        ~UIManager();
    private:
        Canvas* cavs[MAX_CANV_NUM];    //total canvas list
        int _currentindx;              //current seletected canvas index
        int _count;                    //total canvas number
        void _handleCtrl();
};
